/*
 * ReplacementPolicy.cpp
 *
 *  Created on: 18-Oct-2009
 *      Author: atul
 */
#include"ReplacementPolicy.h"

ReplacementPolicy::ReplacementPolicy(Page* bufPage, int numBuf) {
	bufferPage = bufPage;
	numBuff = numBuf;
	for (int i = 0; i < numBuff; i++)
		lst.push_back(i);//initialize LRU list
}
int ReplacementPolicy::getIndexOfFrame() {

	return lst[0];

}
void ReplacementPolicy::update(int frameNo) {
	it = find(lst.begin(), lst.end(), frameNo);
	lst.erase(it);
	lst.push_back(frameNo);
}

